import { Pipe, PipeTransform } from '@angular/core';
import { DomSanitizer } from '@angular/platform-browser';
import { ToolService } from '../service/tool.service';

@Pipe({
  name: 'html'
})
export class HtmlPipe implements PipeTransform {
  constructor(private sanitizer:DomSanitizer){}
  transform(value: any, args?: any): any {
    let res=this.sanitizer.bypassSecurityTrustHtml(value);
    if(ToolService.isEmpty(res)){
        return "";
    }
    return res;
  }

}
